package com.springboot.original.service;

/**
 * @Auther: ZhangYongMing
 * @Date: 2018/12/10 11:28
 * @Description:
 */

import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * 消费者
 * 使用@KafkaListener注解,可以指定:主题,分区,消费组
 */
@Component
public class KafkaConsumer {

    @KafkaListener(topics = {"test1"})
    public void receive(String message){
        System.out.println("======消费消息=======: " + message);
    }
}